<%@ page import="com.casework.Measure" %>
<!doctype html>
<html>
<head>
    <meta name="layout" content="main">
    <g:set var="entityName" value="${message(code: 'measure.label', default: 'Measure')}"/>
    <title><g:message code="default.show.label" args="[entityName]"/></title>
</head>

<body>
<a href="#show-measure" class="skip" tabindex="-1"><g:message code="default.link.skip.label"
                                                              default="Skip to content&hellip;"/></a>
<sec:ifAllGranted roles="ROLE_ADMIN">
<div class="nav" role="navigation">
    <ul>
        <li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
        <li><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]"/></g:link></li>
    </ul>
</div>
</sec:ifAllGranted>

<div id="show-measure" class="content scaffold-show" role="main">
    <h1><g:message code="default.show.label" args="[entityName]"/></h1>
    <g:if test="${flash.message}">
        <div class="message" role="status">${flash.message}</div>
    </g:if>
    <ol class="property-list measure">

        <g:if test="${measureInstance?.legalCase}">
            <li class="fieldcontain">
                <span id="legalcase-label" class="property-label"><g:message
                        code="legalCase.label" default="Case"/></span>
                <span class="property-value" aria-labelledby="legalcase-label">
                    <g:link controller="legalCase" action="show" params="[id:measureInstance.legalCase.id]">
                        M.${measureInstance?.legalCase}
                    </g:link>
                </span>
            </li>
        </g:if>


        <li class="fieldcontain list-of-data">
            <span id="offers-firms" class="property-label"><g:message code="legalCase.firs.label" default="Notifying Parties" /></span>
            <g:each in="${firms}" var="o">
                <span class="property-value" aria-labelledby="offers-firms">
                    <g:link controller="firm" action="show" id="${o.id}">${o?.encodeAsHTML()}</g:link>
                </span>
            </g:each>
        </li>

        <li class="fieldcontain list-of-data">
            <span id="offers-nace" class="property-label"><g:message code="legalCase.nace.label" default="Industry" /></span>

            <g:each in="${descriptions}" var="o">
                <span class="property-value" aria-labelledby="offers-nace">
                    <g:link controller="nace" action="show" id="${o.id}">${o?.encodeAsHTML()}</g:link>
                </span>
            </g:each>
        </li>

        <g:if test="${measureInstance?.competitionConcern}">
           <li class="fieldcontain">
               <span id="competitionConcern-label" class="property-label"><g:message
                       code="measure.competitionConcern.label" default="Competition Concern"/></span>

               <span class="property-value" aria-labelledby="competitionConcern-label"><g:fieldValue
                       bean="${measureInstance}" field="competitionConcern"/></span>

           </li>
       </g:if>

        <g:if test="${measureInstance?.measureClassification}">
            <li class="fieldcontain">
                <span id="measureClassification-label" class="property-label"><g:message
                        code="measure.measureClassification.label" default="Measure Classification"/></span>

                <span class="property-value" aria-labelledby="measureClassification-label">${measureInstance?.measureClassification?.encodeAsHTML()}</span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.fullMeasureDescription}">
            <li class="fieldcontain">
                <span id="fullMeasureDescription-label" class="property-label"><g:message
                        code="measure.fullMeasureDescription.label" default="Full Measure Description"/></span>
                <span class="property-value" aria-labelledby="fullMeasureDescription-label">${measureInstance?.fullMeasureDescription}</span>


            </li>
        </g:if>

        <g:if test="${measureInstance?.leadMeasure}">
            <li class="fieldcontain">
                <span id="leadMeasure-label" class="property-label"><g:message code="measure.leadMeasure.label"
                                                                               default="Lead Measure"/></span>

                <span class="property-value" aria-labelledby="leadMeasure-label"><g:formatBoolean
                        boolean="${measureInstance?.leadMeasure}"/></span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.originOfDivestment}">
            <li class="fieldcontain">
                <span id="originOfDivestment-label" class="property-label"><g:message
                        code="measure.originOfDivestment.label" default="Origin Of Divestment"/> <casework:tooltip title="${g.message(code:'balloon.originOfDivestment')}" /></span>

                <span class="property-value" aria-labelledby="originOfDivestment-label"><g:fieldValue
                        bean="${measureInstance}" field="originOfDivestment"/></span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.term}">
            <li class="fieldcontain">
                <span id="term-label" class="property-label"><g:message code="measure.term.label"
                                                                        default="Term"/> <casework:tooltip title="${g.message(code:'balloon.term')}" /></span>

                <span class="property-value" aria-labelledby="term-label"><g:fieldValue bean="${measureInstance}"
                                                                                        field="term"/></span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.purchaserCriteria}">
            <li class="fieldcontain">
                <span id="purchaserCriteria-label" class="property-label"><g:message
                        code="measure.purchaserCriteria.label" default="Purchaser Criteria"/></span>

                <span class="property-value" aria-labelledby="purchaserCriteria-label"><g:fieldValue
                        bean="${measureInstance}" field="purchaserCriteria"/></span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.clusterSale}">
            <li class="fieldcontain">
                <span id="clusterSale-label" class="property-label"><g:message code="measure.clusterSale.label"
                                                                               default="Cluster Sale"/></span>

                <span class="property-value" aria-labelledby="clusterSale-label"><g:fieldValue bean="${measureInstance}"
                                                                                               field="clusterSale"/></span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.alternativeRemedy}">
            <li class="fieldcontain">
                <span id="alternativeRemedy-label" class="property-label"><g:message
                        code="measure.alternativeRemedy.label" default="Alternative Remedy"/></span>

                <span class="property-value" aria-labelledby="alternativeRemedy-label"><g:fieldValue
                        bean="${measureInstance}" field="alternativeRemedy"/></span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.scopeOfDivestment}">
            <li class="fieldcontain">
                <span id="scopeOfDivestment-label" class="property-label"><g:message
                        code="measure.scopeOfDivestment.label" default="Scope Of Divestment"/> <casework:tooltip title="${g.message(code:'balloon.scopeOfDivestment')}" /></span>

                <span class="property-value" aria-labelledby="scopeOfDivestment-label"><g:fieldValue
                        bean="${measureInstance}" field="scopeOfDivestment"/></span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.tangibleFixedAsset}">
            <li class="fieldcontain">
                <span id="tangibleFixedAsset-label" class="property-label"><g:message
                        code="measure.tangibleFixedAsset.label" default="Tangible Fixed Asset"/> <casework:tooltip title="${g.message(code:'balloon.tangible.fixed')}" /></span>

                <span class="property-value" aria-labelledby="tangibleFixedAsset-label"><g:fieldValue
                        bean="${measureInstance}" field="tangibleFixedAsset"/></span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.intangibleFixedAsset}">
            <li class="fieldcontain">
                <span id="intangibleFixedAsset-label" class="property-label"><g:message
                        code="measure.intangibleFixedAsset.label" default="Intangible Fixed Asset"/> <casework:tooltip title="${g.message(code:'balloon.intangible.fixed')}" /></span>

                <span class="property-value" aria-labelledby="intangibleFixedAsset-label"><g:fieldValue
                        bean="${measureInstance}" field="intangibleFixedAsset"/></span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.currentAsset}">
            <li class="fieldcontain">
                <span id="currentAsset-label" class="property-label"><g:message code="measure.currentAsset.label"
                                                                                default="Current Asset"/> <casework:tooltip title="${g.message(code:'balloon.current.asset')}" /></span>

                <span class="property-value" aria-labelledby="currentAsset-label"><g:fieldValue
                        bean="${measureInstance}" field="currentAsset"/></span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.personnel}">
            <li class="fieldcontain">
                <span id="personnel-label" class="property-label"><g:message code="measure.personnel.label"
                                                                             default="Personnel"/> <casework:tooltip title="${g.message(code:'balloon.personnel')}" /></span>

                <span class="property-value" aria-labelledby="personnel-label"><g:fieldValue bean="${measureInstance}"
                                                                                             field="personnel"/></span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.transitionalService}">
            <li class="fieldcontain">
                <span id="transitionalService-label" class="property-label"><g:message
                        code="measure.transitionalService.label" default="Transitional Service"/> <casework:tooltip title="${g.message(code:'balloon.transitionalService')}" /></span>

                <span class="property-value" aria-labelledby="transitionalService-label"><g:fieldValue
                        bean="${measureInstance}" field="transitionalService"/></span>

            </li>
        </g:if>

        <g:if test="${measureInstance?.comments}">
            <li class="fieldcontain">
                <span id="comments-label" class="property-label"><g:message
                        code="measure.comments.label" default="Comments"/></span>
                <span class="property-value" aria-labelledby="comments-label">${measureInstance?.comments}</span>


            </li>
        </g:if>

        <g:render template="/legalCase/attachedFiles" model="[legalCaseInstance: measureInstance?.legalCase]"/>

    </ol>
<sec:ifAllGranted roles="ROLE_ADMIN">
    <g:form>
        <fieldset class="buttons">
            <g:hiddenField name="id" value="${measureInstance?.id}"/>
            <g:link class="edit" action="edit" id="${measureInstance?.id}"><g:message code="default.button.edit.label"
                                                                                      default="Edit"/></g:link>
            <g:actionSubmit class="delete" action="delete"
                            value="${message(code: 'default.button.delete.label', default: 'Delete')}"
                            onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');"/>
        </fieldset>
    </g:form>
</sec:ifAllGranted>

</div>
<r:script>
$('.tooltip').tipsy();
</r:script>
</body>
</html>
